<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			let date = new Date();
			console.log(date);
			console.log(date.toLocaleDateString());
			console.log(date.toDateString());
			console.log(date.toLocaleTimeString());
			console.log(date.getFullYear());
			console.log(date.getYear());//了解一下，基本不用
			console.log(date.getDate());//获取天数
			
			function format(date) {
				return date.getFullYear() + "年" + date.getMonth() + "月" + date.getDate() + "日";
			}
			
			console.log(format(date));
			
			// parseInt()：是一个全局函数，将字符串转换为整数
			let str = "123";
			console.log(str + 1);
			console.log(parseInt(str) + 1);
		</script>
	</body>
</html>
